const express = require('express')
const fs = require('fs')
const morgan = require('morgan')
const path = require('path')
const app = express()
const accessLogStream = fs.createWriteStream(path.join(__dirname, 'access.log'), { flags: 'a' })
app.use(morgan('combined',{ stream: accessLogStream }))
app.get('/home', (req, res,next) => {
  console.log('home server')
  res.end('home server')
})
app.listen(3000, () => {
  console.log('server listed')
})